﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Management.master" AutoEventWireup="true" CodeFile="callme-history.aspx.cs" 
 EnableEventValidation="false" Inherits="User_callme_history" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<div class="contents">
    <asp:ScriptManager ID="scriptManager" runat="server"></asp:ScriptManager>
        <table width="100%" cellpadding="3" cellspacing="0" border="0">
            <tr>
                <td>
                    <h1>Car - Trackers - Call Me Requests</h1>
                </td>
            </tr>
            <tr id="trSearch" runat="server">
                <td>
                    <b>Company Name</b> :
                    <asp:DropDownList ID="ddlProvider" runat="server">
                        <asp:ListItem Value="0">All</asp:ListItem>
                        <asp:ListItem Value="16">AXA</asp:ListItem>
                        <asp:ListItem Value="11">AZCP</asp:ListItem>
                        <asp:ListItem Value="32">BKI</asp:ListItem>
                        <asp:ListItem Value="31">Chartis</asp:ListItem>
                        <asp:ListItem Value="35">KrungThai</asp:ListItem>
                        <asp:ListItem Value="41">Kurnia</asp:ListItem>
                        <asp:ListItem Value="29">LMG</asp:ListItem>
                        <asp:ListItem Value="39">Mittare</asp:ListItem>
                        <asp:ListItem Value="12">MSIG</asp:ListItem>
                        <asp:ListItem Value="33">MuangThai</asp:ListItem>
                        <asp:ListItem Value="46">Tokio Marine</asp:ListItem>
                    </asp:DropDownList>&nbsp;
                    <b>CallMe Time</b> :
                    <asp:DropDownList runat="server" ID="ddlCallMeTime">
                        <asp:ListItem Value="0" Text="All" />
                        <asp:ListItem Value="1" Text="Morning" />
                        <asp:ListItem Value="2" Text="Afternoon" />
                        <asp:ListItem Value="3" Text="Evening" />
                        <asp:ListItem Value="4" Text="AnyTime" />
                    </asp:DropDownList>&nbsp;
                    <b>Report Type</b> :
                    <asp:DropDownList ID="ddlReportType" runat="server" AutoPostBack="true" 
                        onselectedindexchanged="ddlReportType_SelectedIndexChanged">
                        <asp:ListItem Value="0">Monthly</asp:ListItem>
                        <asp:ListItem Value="1" Selected="True">Daily</asp:ListItem>
                        <asp:ListItem Value="2">Customize</asp:ListItem>
                    </asp:DropDownList>&nbsp;
                    <b><asp:Label ID="lblFromDate" runat="server"></asp:Label></b>
                    <asp:DropDownList ID="ddlDay1" runat="server" ToolTip="Choose Day">
                        <asp:ListItem Value="01">01</asp:ListItem>
                        <asp:ListItem Value="02">02</asp:ListItem>
                        <asp:ListItem Value="03">03</asp:ListItem>
                        <asp:ListItem Value="04">04</asp:ListItem>
                        <asp:ListItem Value="05">05</asp:ListItem>
                        <asp:ListItem Value="06">06</asp:ListItem>
                        <asp:ListItem Value="07">07</asp:ListItem>
                        <asp:ListItem Value="08">08</asp:ListItem>
                        <asp:ListItem Value="09">09</asp:ListItem>
                        <asp:ListItem Value="10">10</asp:ListItem>
                        <asp:ListItem Value="11">11</asp:ListItem>
                        <asp:ListItem Value="12">12</asp:ListItem>
                        <asp:ListItem Value="13">13</asp:ListItem>
                        <asp:ListItem Value="14">14</asp:ListItem>
                        <asp:ListItem Value="15">15</asp:ListItem>
                        <asp:ListItem Value="16">16</asp:ListItem>
                        <asp:ListItem Value="17">17</asp:ListItem>
                        <asp:ListItem Value="18">18</asp:ListItem>
                        <asp:ListItem Value="19">19</asp:ListItem>
                        <asp:ListItem Value="20">20</asp:ListItem>
                        <asp:ListItem Value="21">21</asp:ListItem>
                        <asp:ListItem Value="22">22</asp:ListItem>
                        <asp:ListItem Value="23">23</asp:ListItem>
                        <asp:ListItem Value="24">24</asp:ListItem>
                        <asp:ListItem Value="25">25</asp:ListItem>
                        <asp:ListItem Value="26">26</asp:ListItem>
                        <asp:ListItem Value="27">27</asp:ListItem>
                        <asp:ListItem Value="28">28</asp:ListItem>
                        <asp:ListItem Value="29">29</asp:ListItem>
                        <asp:ListItem Value="30">30</asp:ListItem>
                        <asp:ListItem Value="31">31</asp:ListItem>
                    </asp:DropDownList>
                    <asp:DropDownList ID="ddlMonth1" runat="server"> 
                        <asp:ListItem Value="01">Jan</asp:ListItem>
                        <asp:ListItem Value="02">Feb</asp:ListItem>
                        <asp:ListItem Value="03">Mar</asp:ListItem>
                        <asp:ListItem Value="04">Apr</asp:ListItem>
                        <asp:ListItem Value="05">May</asp:ListItem>
                        <asp:ListItem Value="06">Jun</asp:ListItem>
                        <asp:ListItem Value="07">Jul</asp:ListItem>
                        <asp:ListItem Value="08">Aug</asp:ListItem>
                        <asp:ListItem Value="09">Sep</asp:ListItem>
                        <asp:ListItem Value="10">Oct</asp:ListItem>
                        <asp:ListItem Value="11">Nov</asp:ListItem>
                        <asp:ListItem Value="12">Dec</asp:ListItem>
                    </asp:DropDownList>
                    <asp:DropDownList ID="ddlYear1" runat="server">
                        <asp:ListItem Value="2010">2010</asp:ListItem>
                        <asp:ListItem Value="2011">2011</asp:ListItem>
                        <asp:ListItem Value="2012">2012</asp:ListItem>
                        <asp:ListItem Value="2013">2013</asp:ListItem>
                    </asp:DropDownList>
                        <b><asp:Label ID="lblToDate" runat="server"></asp:Label></b>
                    <asp:DropDownList ID="ddlDay2" runat="server" ToolTip="Choose Day">
                        <asp:ListItem Value="01">01</asp:ListItem>
                        <asp:ListItem Value="02">02</asp:ListItem>
                        <asp:ListItem Value="03">03</asp:ListItem>
                        <asp:ListItem Value="04">04</asp:ListItem>
                        <asp:ListItem Value="05">05</asp:ListItem>
                        <asp:ListItem Value="06">06</asp:ListItem>
                        <asp:ListItem Value="07">07</asp:ListItem>
                        <asp:ListItem Value="08">08</asp:ListItem>
                        <asp:ListItem Value="09">09</asp:ListItem>
                        <asp:ListItem Value="10">10</asp:ListItem>
                        <asp:ListItem Value="11">11</asp:ListItem>
                        <asp:ListItem Value="12">12</asp:ListItem>
                        <asp:ListItem Value="13">13</asp:ListItem>
                        <asp:ListItem Value="14">14</asp:ListItem>
                        <asp:ListItem Value="15">15</asp:ListItem>
                        <asp:ListItem Value="16">16</asp:ListItem>
                        <asp:ListItem Value="17">17</asp:ListItem>
                        <asp:ListItem Value="18">18</asp:ListItem>
                        <asp:ListItem Value="19">19</asp:ListItem>
                        <asp:ListItem Value="20">20</asp:ListItem>
                        <asp:ListItem Value="21">21</asp:ListItem>
                        <asp:ListItem Value="22">22</asp:ListItem>
                        <asp:ListItem Value="23">23</asp:ListItem>
                        <asp:ListItem Value="24">24</asp:ListItem>
                        <asp:ListItem Value="25">25</asp:ListItem>
                        <asp:ListItem Value="26">26</asp:ListItem>
                        <asp:ListItem Value="27">27</asp:ListItem>
                        <asp:ListItem Value="28">28</asp:ListItem>
                        <asp:ListItem Value="29">29</asp:ListItem>
                        <asp:ListItem Value="30">30</asp:ListItem>
                        <asp:ListItem Value="31">31</asp:ListItem>
                    </asp:DropDownList>
                    <asp:DropDownList ID="ddlMonth2" runat="server"> 
                        <asp:ListItem Value="01">Jan</asp:ListItem>
                        <asp:ListItem Value="02">Feb</asp:ListItem>
                        <asp:ListItem Value="03">Mar</asp:ListItem>
                        <asp:ListItem Value="04">Apr</asp:ListItem>
                        <asp:ListItem Value="05">May</asp:ListItem>
                        <asp:ListItem Value="06">Jun</asp:ListItem>
                        <asp:ListItem Value="07">Jul</asp:ListItem>
                        <asp:ListItem Value="08">Aug</asp:ListItem>
                        <asp:ListItem Value="09">Sep</asp:ListItem>
                        <asp:ListItem Value="10">Oct</asp:ListItem>
                        <asp:ListItem Value="11">Nov</asp:ListItem>
                        <asp:ListItem Value="12">Dec</asp:ListItem>
                    </asp:DropDownList>
                    <asp:DropDownList ID="ddlYear2" runat="server">
                        <asp:ListItem Value="2010">2010</asp:ListItem>
                        <asp:ListItem Value="2011">2011</asp:ListItem>
                        <asp:ListItem Value="2012">2012</asp:ListItem>
                        <asp:ListItem Value="2013">2013</asp:ListItem>
                    </asp:DropDownList>
                    <div style="display: none">
                        <asp:TextBox ID="txtReportDate1" runat="server"></asp:TextBox>
                        <asp:TextBox ID="txtReportDate2" runat="server"></asp:TextBox>
                        <asp:TextBox ID="txtUserId" runat="server" Text="0"></asp:TextBox>
                    </div>
                    &nbsp;<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Submit" />&nbsp;&nbsp;&nbsp;<asp:Label ID="lblRecordCount" runat="server"></asp:Label>
                    <span class="admin_gridstyle" style="float:right; padding-right:5px">
                        <asp:HyperLink Visible="false" ID="hplPrint" NavigateUrl="" Target="_blank" runat="server"><img src="images/icons/icon_print.png" alt="print preview" /></asp:HyperLink>
                    </span>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:UpdatePanel runat="server" ID="upnlCallMeSummary">
                    <ContentTemplate>
                    <asp:Label ID="lblError" runat="server" ForeColor="Red"></asp:Label>
                    <asp:GridView ID="grvCallMeSummary" runat="server" AutoGenerateColumns="False"  AllowSorting="true" 
                    Cellspacing="3" CellPadding="3" Width="100%" CssClass="admin_gridstyle" PagerStyle-CssClass="pgr" 
                    EmptyDataText="There are no data records to display." GridLines="None" DataKeyNames="CallMeId" 
                    onsorting="grvCallMeSummary_Sorting"> 
                    <Columns>
                        <asp:BoundField DataField="CallMeId" HeaderText="CallMeId" SortExpression="CallMeId" Visible="false" />
                        <asp:BoundField DataField="ProductId" HeaderText="CECarId" SortExpression="ProductId" Visible="false" />
                        <asp:BoundField DataField="RefCEUserId" HeaderText="UserId" SortExpression="RefCEUserId" />
                        <asp:BoundField DataField="FullName" HeaderText="Full Name" SortExpression="FullName" Visible="false" />
                        <asp:BoundField DataField="ContactNo" HeaderText="Contact No." SortExpression="ContactNo" Visible="false" />
                        <asp:BoundField DataField="CallMeTime" HeaderText="CallMe Time" SortExpression="CallMeTime" />
                        <asp:BoundField DataField="CompanyName" HeaderText="Insurance Company" SortExpression="CompanyName" />
                        <asp:BoundField DataField="MakeModel" HeaderText="Car MakeModel" SortExpression="MakeModel" />
                        <asp:BoundField DataField="ModifiedDate" DataFormatString="{0:dd/MM/yyyy hh:mm:ss tt}" HeaderText="Posted Date" SortExpression="ModifiedDate" />
                        <asp:CommandField ShowSelectButton="True" HeaderText="Call Status" />
                        <asp:HyperLinkField DataNavigateUrlFields="CarQuoteUrl" Target="_blank" HeaderText="View" Text="View" />
                    </Columns>
                    <FooterStyle />
                    <PagerStyle />
                    <SelectedRowStyle BackColor="LightGray" />
                    <HeaderStyle CssClass="admin_gridheader" />
                    <EditRowStyle />
                    <AlternatingRowStyle CssClass="admin_gridodd" />
                    <RowStyle CssClass="admin_grideven" />
                </asp:GridView>
                </ContentTemplate>
                </asp:UpdatePanel>
               </td>
            </tr>
            <tr>
                <td>
                    <asp:Button ID="btnExport" runat="server" Text="Export" Visible="false" onclick="btnExport_Click" />
                </td>
            </tr>
            <tr>
                <td>
                    <h3>
                        CallMe Status</h3>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:UpdatePanel runat="server" ID="uplCallStatus">
                    <ContentTemplate>
                    <asp:GridView ID="grvCallMeAgentSummary" runat="server" AllowSorting="True" AutoGenerateColumns="False"
                        CellPadding="2" CssClass="admin_gridstyle" EmptyDataText="There are no data records to display."
                        GridLines="None" Width="100%" DataSourceID="sqlDsCallMeAgent" DataKeyNames="ProductId">
                        <FooterStyle />
                        <PagerStyle />
                        <Columns>
                            <asp:BoundField DataField="RefCEUserId" HeaderText="UserId" SortExpression="RefCEUserId" Visible="false" />
                            <asp:BoundField DataField="ProductId" HeaderText="ProductId" SortExpression="ProductId" Visible="false" />
                            <asp:BoundField DataField="ProviderCompanyId" HeaderText="ProviderCompanyId" SortExpression="ProviderCompanyId" Visible="false" />
                            <asp:BoundField DataField="CompanyName" HeaderText="Insurance Company" SortExpression="CompanyName" />
                            <asp:BoundField DataField="AgentName" HeaderText="Agent Name" SortExpression="AgentName" />
                            <asp:BoundField DataField="CallStatus" HeaderText="Call Status" SortExpression="CallStatus" />
                            <asp:BoundField DataField="Remark" HeaderText="Remark" SortExpression="Remark" ItemStyle-Width="550px" />
                            <asp:BoundField DataField="ModifiedDate" DataFormatString="{0:dd/MM/yyyy hh:mm:ss tt}" HeaderText="Posted Date" SortExpression="ModifiedDate" />
                        </Columns>
                        <FooterStyle />
                        <PagerStyle />
                        <SelectedRowStyle />
                        <HeaderStyle CssClass="admin_gridheader" />
                        <EditRowStyle />
                        <AlternatingRowStyle CssClass="admin_gridodd" />
                        <RowStyle CssClass="admin_grideven" />
                    </asp:GridView>
                    <asp:SqlDataSource ID="sqlDsCallMeAgent" runat="server" ConnectionString="<%$ ConnectionStrings:GGR_DBConnectionString %>"
                        SelectCommand="sprocReportCallMeStatusSelectSingleItemByCallMeId" SelectCommandType="StoredProcedure">
                        <SelectParameters>
                            <asp:ControlParameter ControlID="grvCallMeSummary" Name="CallMeId" PropertyName="SelectedValue" Type="Int64" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                    </ContentTemplate>
                    </asp:UpdatePanel>
                </td>
            </tr>
        </table>
   </div>
</asp:Content>

